# 1. 导入必要的模块: request
# 2. 获取 GET 请求数据（URL的query中,  ?key1=value1&key2=value2...）
#        value = request.args.get(key)
# 3. 获取 POST 请求数据 (载荷 payload)
#        value = request.form.get(key)


from flask import Flask,request
app = Flask(__name__)

@app.route('/',methods=['GET'])
def index():
    return "hello"

@app.route('/login',methods=['GET','POST'])
def login():
    # username = request.args.get('username')
    # password = request.args.get('password')
    username = request.form.get('username')
    password = request.form.get('password')
    print(username,password)
    return "login"

if __name__ == '__main__':
    app.run(debug=True)